/*     */ package com.zimbra.qa.unittest.prov.ldap;
/*     */ 
/*     */ import com.google.common.collect.Maps;
/*     */ import com.zimbra.common.account.Key.AccountBy;
/*     */ import com.zimbra.common.account.Key.DataSourceBy;
/*     */ import com.zimbra.common.localconfig.KnownKey;
/*     */ import com.zimbra.common.localconfig.LC;
/*     */ import com.zimbra.common.service.ServiceException;
/*     */ import com.zimbra.common.util.StringUtil;
/*     */ import com.zimbra.cs.account.Account;
/*     */ import com.zimbra.cs.account.AccountServiceException;
/*     */ import com.zimbra.cs.account.CalendarResource;
/*     */ import com.zimbra.cs.account.Cos;
/*     */ import com.zimbra.cs.account.DataSource;
/*     */ import com.zimbra.cs.account.Domain;
/*     */ import com.zimbra.cs.account.Provisioning;
/*     */ import com.zimbra.cs.account.Server;
/*     */ import com.zimbra.qa.unittest.TestUtil;
/*     */ import com.zimbra.qa.unittest.prov.Names;
/*     */ import com.zimbra.soap.admin.type.CacheEntryType;
/*     */ import com.zimbra.soap.admin.type.DataSourceType;
/*     */ import java.util.HashMap;
/*     */ import java.util.HashSet;
/*     */ import java.util.List;
/*     */ import java.util.Map;
/*     */ import java.util.Set;
/*     */ import org.junit.AfterClass;
/*     */ import org.junit.Assert;
/*     */ import org.junit.BeforeClass;
/*     */ import org.junit.Test;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class TestLdapProvAccount
/*     */   extends LdapTest
/*     */ {
/*     */   private static LdapProvTestUtil provUtil;
/*     */   private static Provisioning prov;
/*     */   private static Domain domain;
/*     */   
/*     */   @BeforeClass
/*     */   public static void init()
/*     */     throws Exception
/*     */   {
/*  56 */     provUtil = new LdapProvTestUtil();
/*  57 */     prov = provUtil.getProv();
/*  58 */     domain = provUtil.createDomain(baseDomainName(), null);
/*     */   }
/*     */   
/*     */   @AfterClass
/*     */   public static void cleanup() throws Exception {
/*  63 */     Cleanup.deleteAll(new String[] { baseDomainName() });
/*     */   }
/*     */   
/*     */   private Account createAccount(String localPart) throws Exception {
/*  67 */     return createAccount(localPart, null);
/*     */   }
/*     */   
/*     */   private Account createAccount(String localPart, Map<String, Object> attrs) throws Exception
/*     */   {
/*  72 */     return provUtil.createAccount(localPart, domain, attrs);
/*     */   }
/*     */   
/*     */   private CalendarResource createCalendarResource(String localPart) throws Exception {
/*  76 */     return createCalendarResource(localPart, null);
/*     */   }
/*     */   
/*     */   private CalendarResource createCalendarResource(String localPart, Map<String, Object> attrs) throws Exception
/*     */   {
/*  81 */     return provUtil.createCalendarResource(localPart, domain, attrs);
/*     */   }
/*     */   
/*     */   private void deleteAccount(Account acct) throws Exception {
/*  85 */     provUtil.deleteAccount(acct);
/*     */   }
/*     */   
/*     */   private Server createServer(String serverName, Map<String, Object> attrs) throws Exception
/*     */   {
/*  90 */     return provUtil.createServer(serverName, attrs);
/*     */   }
/*     */   
/*     */   private Server createServer(String serverName) throws Exception
/*     */   {
/*  95 */     return createServer(serverName, null);
/*     */   }
/*     */   
/*     */   private void deleteServer(Server server) throws Exception {
/*  99 */     provUtil.deleteServer(server);
/*     */   }
/*     */   
/*     */   private Cos createCos(String cosName, Map<String, Object> attrs) throws Exception {
/* 103 */     return provUtil.createCos(cosName, attrs);
/*     */   }
/*     */   
/*     */   private void deleteCos(Cos cos) throws Exception {
/* 107 */     provUtil.deleteCos(cos);
/*     */   }
/*     */   
/*     */   private void getAccountByAdminName(String adminName) throws Exception {
/* 111 */     prov.flushCache(CacheEntryType.account, null);
/* 112 */     Account acct = prov.get(Key.AccountBy.adminName, adminName);
/* 113 */     Assert.assertNotNull(acct);
/*     */   }
/*     */   
/*     */   private void getAccountByAppAdminName(String appAdminName) throws Exception {
/* 117 */     prov.flushCache(CacheEntryType.account, null);
/* 118 */     Account acct = prov.get(Key.AccountBy.appAdminName, appAdminName);
/* 119 */     Assert.assertNotNull(acct);
/*     */   }
/*     */   
/*     */   private void getAccountById(String acctId) throws Exception {
/* 123 */     prov.flushCache(CacheEntryType.account, null);
/* 124 */     Account acct = prov.get(Key.AccountBy.id, acctId);
/* 125 */     Assert.assertNotNull(acct);
/*     */   }
/*     */   
/*     */   private void getAccountByName(String name) throws Exception {
/* 129 */     prov.flushCache(CacheEntryType.account, null);
/* 130 */     Account acct = prov.get(Key.AccountBy.name, name);
/* 131 */     Assert.assertNotNull(acct);
/*     */   }
/*     */   
/*     */   private void getAccountByForeignPrincipal(String foreignPrincipal) throws Exception {
/* 135 */     prov.flushCache(CacheEntryType.account, null);
/* 136 */     Account acct = prov.get(Key.AccountBy.foreignPrincipal, foreignPrincipal);
/* 137 */     Assert.assertNotNull(acct);
/*     */   }
/*     */   
/*     */   private void getAccountByKrb5Principal(String krb5Principal) throws Exception {
/* 141 */     prov.flushCache(CacheEntryType.account, null);
/* 142 */     Account acct = prov.get(Key.AccountBy.krb5Principal, krb5Principal);
/* 143 */     Assert.assertNotNull(acct);
/*     */   }
/*     */   
/*     */   private DataSource createDataSource(Account acct, String dataSourceName) throws Exception {
/* 147 */     Map<String, Object> attrs = new HashMap();
/* 148 */     attrs.put("zimbraDataSourceEnabled", "TRUE");
/* 149 */     attrs.put("zimbraDataSourceFolderId", "123");
/* 150 */     attrs.put("zimbraDataSourceConnectionType", "ssl");
/* 151 */     attrs.put("zimbraDataSourceHost", "zimbra.com");
/* 152 */     attrs.put("zimbraDataSourcePort", "9999");
/* 153 */     DataSource ds = prov.createDataSource(acct, DataSourceType.pop3, dataSourceName, attrs);
/* 154 */     return ds;
/*     */   }
/*     */   
/*     */   @Test
/*     */   public void createAccount() throws Exception {
/* 159 */     String ACCT_NAME_LOCALPART = Names.makeAccountNameLocalPart(genAcctNameLocalPart());
/* 160 */     Account acct = createAccount(ACCT_NAME_LOCALPART);
/* 161 */     deleteAccount(acct);
/*     */   }
/*     */   
/*     */   @Test
/*     */   public void createAccountAlreadyExists() throws Exception {
/* 166 */     String ACCT_NAME_LOCALPART = Names.makeAccountNameLocalPart(genAcctNameLocalPart());
/* 167 */     Account acct = createAccount(ACCT_NAME_LOCALPART);
/*     */     
/* 169 */     boolean caughtException = false;
/*     */     try {
/* 171 */       prov.createAccount(acct.getName(), "test123", null);
/*     */     } catch (AccountServiceException e) {
/* 173 */       if ("account.ACCOUNT_EXISTS".equals(e.getCode())) {
/* 174 */         caughtException = true;
/*     */       }
/*     */     }
/* 177 */     Assert.assertTrue(caughtException);
/*     */     
/* 179 */     deleteAccount(acct);
/*     */   }
/*     */   
/*     */   @Test
/*     */   public void getAccount() throws Exception {
/* 184 */     String ACCT_NAME = "getAccount";
/*     */     
/* 186 */     String FOREIGN_PRINCIPAL = "test:foreignPrincipal";
/* 187 */     String KRB5_PRINCIPAL = "krb5Principal";
/* 188 */     String KRB5_PRINCIPAL_ATTR_VALUE = "kerberos5:" + KRB5_PRINCIPAL;
/* 189 */     Map<String, Object> attrs = new HashMap();
/* 190 */     StringUtil.addToMultiMap(attrs, "zimbraForeignPrincipal", FOREIGN_PRINCIPAL);
/* 191 */     StringUtil.addToMultiMap(attrs, "zimbraForeignPrincipal", KRB5_PRINCIPAL_ATTR_VALUE);
/* 192 */     Account acct = createAccount(ACCT_NAME, attrs);
/*     */     
/* 194 */     getAccountByAdminName(LC.zimbra_ldap_user.value());
/* 195 */     getAccountByAppAdminName("zmnginx");
/* 196 */     getAccountById(acct.getId());
/* 197 */     getAccountByName(acct.getName());
/* 198 */     getAccountByForeignPrincipal(FOREIGN_PRINCIPAL);
/* 199 */     getAccountByKrb5Principal(KRB5_PRINCIPAL);
/*     */     
/* 201 */     deleteAccount(acct);
/*     */   }
/*     */   
/*     */   @Test
/*     */   public void getAllAdminAccounts() throws Exception {
/* 206 */     String ADMIN_ACCT_NAME_1 = genAcctNameLocalPart("1");
/* 207 */     String ADMIN_ACCT_NAME_2 = genAcctNameLocalPart("2");
/*     */     
/* 209 */     Map<String, Object> acct1Attrs1 = new HashMap();
/* 210 */     acct1Attrs1.put("zimbraIsAdminAccount", "TRUE");
/* 211 */     Map<String, Object> acct1Attrs2 = new HashMap();
/* 212 */     acct1Attrs2.put("zimbraIsDelegatedAdminAccount", "TRUE");
/*     */     
/* 214 */     Account adminAcct1 = createAccount(ADMIN_ACCT_NAME_1, acct1Attrs1);
/* 215 */     Account adminAcct2 = createAccount(ADMIN_ACCT_NAME_2, acct1Attrs2);
/*     */     
/* 217 */     List<Account> allAdminAccts = prov.getAllAdminAccounts();
/*     */     
/* 219 */     Set<String> allAdminAcctIds = new HashSet();
/* 220 */     for (Account acct : allAdminAccts) {
/* 221 */       allAdminAcctIds.add(acct.getId());
/*     */     }
/*     */     
/* 224 */     Assert.assertTrue(allAdminAcctIds.contains(adminAcct1.getId()));
/* 225 */     Assert.assertTrue(allAdminAcctIds.contains(adminAcct2.getId()));
/*     */     
/* 227 */     deleteAccount(adminAcct1);
/* 228 */     deleteAccount(adminAcct2);
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */   @Test
/*     */   public void renameAccount()
/*     */     throws Exception
/*     */   {
/* 237 */     String ACCT_NAME_LOCALPART = Names.makeAccountNameLocalPart(genAcctNameLocalPart());
/*     */     
/* 239 */     String ACCT_NEW_NAME_LOCALPART = Names.makeAccountNameLocalPart(genAcctNameLocalPart("new"));
/*     */     
/*     */ 
/* 242 */     String ACCT_NEW_NAME = TestUtil.getAddress(ACCT_NEW_NAME_LOCALPART, domain.getName()).toLowerCase();
/*     */     
/*     */ 
/*     */ 
/* 246 */     Account acct = createAccount(ACCT_NAME_LOCALPART);
/* 247 */     String acctId = acct.getId();
/*     */     
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/* 254 */     String DATA_SOURCE_NAME_1 = Names.makeDataSourceName(genDataSourceName("1"));
/* 255 */     String DATA_SOURCE_NAME_2 = Names.makeDataSourceName(genDataSourceName("2"));
/* 256 */     String DATA_SOURCE_NAME_3 = Names.makeDataSourceName(genDataSourceName("3"));
/*     */     
/* 258 */     DataSource ds1 = createDataSource(acct, DATA_SOURCE_NAME_1);
/* 259 */     DataSource ds2 = createDataSource(acct, DATA_SOURCE_NAME_2);
/* 260 */     DataSource ds3 = createDataSource(acct, DATA_SOURCE_NAME_3);
/* 261 */     String DATA_SOURCE_ID_1 = ds1.getId();
/* 262 */     String DATA_SOURCE_ID_2 = ds2.getId();
/* 263 */     String DATA_SOURCE_ID_3 = ds3.getId();
/*     */     
/*     */ 
/* 266 */     Map<String, Object> attrs = Maps.newHashMap();
/* 267 */     attrs.put("zimbraPrefAllowAddressForDelegatedSender", acct.getName());
/* 268 */     prov.modifyAttrs(acct, attrs);
/*     */     
/* 270 */     prov.renameAccount(acctId, ACCT_NEW_NAME);
/*     */     
/* 272 */     prov.flushCache(CacheEntryType.account, null);
/* 273 */     Account renamedAcct = prov.get(Key.AccountBy.name, ACCT_NEW_NAME);
/*     */     
/* 275 */     Assert.assertEquals(acctId, renamedAcct.getId());
/* 276 */     Assert.assertEquals(ACCT_NEW_NAME, renamedAcct.getName());
/* 277 */     Assert.assertEquals(ACCT_NEW_NAME_LOCALPART, renamedAcct.getUid());
/*     */     
/*     */ 
/* 280 */     Assert.assertEquals(DATA_SOURCE_ID_1, prov.get(renamedAcct, Key.DataSourceBy.name, DATA_SOURCE_NAME_1).getId());
/* 281 */     Assert.assertEquals(DATA_SOURCE_ID_2, prov.get(renamedAcct, Key.DataSourceBy.name, DATA_SOURCE_NAME_2).getId());
/* 282 */     Assert.assertEquals(DATA_SOURCE_ID_3, prov.get(renamedAcct, Key.DataSourceBy.name, DATA_SOURCE_NAME_3).getId());
/*     */     
/*     */ 
/* 285 */     Set<String> addrsForDelegatedSender = renamedAcct.getMultiAttrSet("zimbraPrefAllowAddressForDelegatedSender");
/* 286 */     Assert.assertEquals(1L, addrsForDelegatedSender.size());
/* 287 */     Assert.assertTrue(addrsForDelegatedSender.contains(ACCT_NEW_NAME));
/*     */     
/* 289 */     deleteAccount(renamedAcct);
/*     */   }
/*     */   
/*     */   @Test
/*     */   public void renameAccountDomainChanged() throws Exception {
/* 294 */     String ACCT_NAME_LOCALPART = Names.makeAccountNameLocalPart(genAcctNameLocalPart());
/*     */     
/* 296 */     String NEW_DOMAIN_NAME = genDomainSegmentName() + "." + baseDomainName();
/* 297 */     Domain newDomain = provUtil.createDomain(NEW_DOMAIN_NAME);
/* 298 */     String ACCT_NEW_NAME_LOCALPART = Names.makeAccountNameLocalPart(genAcctNameLocalPart("new"));
/* 299 */     String ACCT_NEW_NAME = TestUtil.getAddress(ACCT_NEW_NAME_LOCALPART, NEW_DOMAIN_NAME).toLowerCase();
/*     */     
/*     */ 
/* 302 */     Account acct = createAccount(ACCT_NAME_LOCALPART);
/* 303 */     String acctId = acct.getId();
/*     */     
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/* 310 */     String DATA_SOURCE_NAME_1 = Names.makeDataSourceName("ds1");
/* 311 */     String DATA_SOURCE_NAME_2 = Names.makeDataSourceName("ds2");
/* 312 */     String DATA_SOURCE_NAME_3 = Names.makeDataSourceName("ds3");
/*     */     
/* 314 */     DataSource ds1 = createDataSource(acct, DATA_SOURCE_NAME_1);
/* 315 */     DataSource ds2 = createDataSource(acct, DATA_SOURCE_NAME_2);
/* 316 */     DataSource ds3 = createDataSource(acct, DATA_SOURCE_NAME_3);
/* 317 */     String DATA_SOURCE_ID_1 = ds1.getId();
/* 318 */     String DATA_SOURCE_ID_2 = ds2.getId();
/* 319 */     String DATA_SOURCE_ID_3 = ds3.getId();
/*     */     
/*     */ 
/*     */ 
/* 323 */     String ALIAS_NAME_LOCALPART_1 = Names.makeAccountNameLocalPart(genAcctNameLocalPart("alias1"));
/* 324 */     String ALIAS_NAME_LOCALPART_2 = Names.makeAccountNameLocalPart(genAcctNameLocalPart("alias2"));
/* 325 */     String ALIAS_NAME_1 = TestUtil.getAddress(ALIAS_NAME_LOCALPART_1, domain.getName()).toLowerCase();
/* 326 */     String ALIAS_NAME_2 = TestUtil.getAddress(ALIAS_NAME_LOCALPART_2, domain.getName()).toLowerCase();
/* 327 */     String ALIAS_NEW_NAME_1 = TestUtil.getAddress(ALIAS_NAME_LOCALPART_1, NEW_DOMAIN_NAME).toLowerCase();
/* 328 */     String ALIAS_NEW_NAME_2 = TestUtil.getAddress(ALIAS_NAME_LOCALPART_2, NEW_DOMAIN_NAME).toLowerCase();
/* 329 */     prov.addAlias(acct, ALIAS_NAME_1);
/* 330 */     prov.addAlias(acct, ALIAS_NAME_2);
/*     */     
/*     */ 
/* 333 */     Map<String, Object> attrs = Maps.newHashMap();
/* 334 */     attrs.put("zimbraPrefAllowAddressForDelegatedSender", new String[] { acct.getName(), ALIAS_NAME_1, ALIAS_NAME_2 });
/*     */     
/* 336 */     prov.modifyAttrs(acct, attrs);
/*     */     
/* 338 */     prov.renameAccount(acctId, ACCT_NEW_NAME);
/*     */     
/* 340 */     prov.flushCache(CacheEntryType.account, null);
/* 341 */     Account renamedAcct = prov.get(Key.AccountBy.name, ACCT_NEW_NAME);
/*     */     
/* 343 */     Assert.assertEquals(acctId, renamedAcct.getId());
/* 344 */     Assert.assertEquals(ACCT_NEW_NAME, renamedAcct.getName());
/*     */     
/*     */ 
/* 347 */     Assert.assertEquals(DATA_SOURCE_ID_1, prov.get(renamedAcct, Key.DataSourceBy.name, DATA_SOURCE_NAME_1).getId());
/* 348 */     Assert.assertEquals(DATA_SOURCE_ID_2, prov.get(renamedAcct, Key.DataSourceBy.name, DATA_SOURCE_NAME_2).getId());
/* 349 */     Assert.assertEquals(DATA_SOURCE_ID_3, prov.get(renamedAcct, Key.DataSourceBy.name, DATA_SOURCE_NAME_3).getId());
/*     */     
/*     */ 
/* 352 */     Account acctByAlias1 = prov.get(Key.AccountBy.name, ALIAS_NEW_NAME_1);
/* 353 */     Assert.assertEquals(acctId, acctByAlias1.getId());
/* 354 */     Account acctByAlias2 = prov.get(Key.AccountBy.name, ALIAS_NEW_NAME_2);
/* 355 */     Assert.assertEquals(acctId, acctByAlias2.getId());
/* 356 */     Set<String> aliases = renamedAcct.getMultiAttrSet("zimbraMailAlias");
/* 357 */     Assert.assertEquals(2L, aliases.size());
/* 358 */     Assert.assertTrue(aliases.contains(ALIAS_NEW_NAME_1));
/* 359 */     Assert.assertTrue(aliases.contains(ALIAS_NEW_NAME_2));
/*     */     
/*     */ 
/* 362 */     Set<String> addrsForDelegatedSender = renamedAcct.getMultiAttrSet("zimbraPrefAllowAddressForDelegatedSender");
/*     */     
/* 364 */     Assert.assertEquals(3L, addrsForDelegatedSender.size());
/* 365 */     Assert.assertTrue(addrsForDelegatedSender.contains(ACCT_NEW_NAME));
/* 366 */     Assert.assertTrue(addrsForDelegatedSender.contains(ALIAS_NEW_NAME_1));
/* 367 */     Assert.assertTrue(addrsForDelegatedSender.contains(ALIAS_NEW_NAME_2));
/*     */     
/* 369 */     deleteAccount(renamedAcct);
/* 370 */     provUtil.deleteDomain(newDomain);
/*     */   }
/*     */   
/*     */   @Test
/*     */   public void renameAccountAlreadyExists() throws Exception {
/* 375 */     String ACCT_NAME_LOCALPART = Names.makeAccountNameLocalPart(genAcctNameLocalPart());
/* 376 */     String ACCT_NAME_EXISTS_LOCALPART = Names.makeAccountNameLocalPart(genAcctNameLocalPart("exists"));
/*     */     
/* 378 */     Account acct = createAccount(ACCT_NAME_LOCALPART);
/* 379 */     Account acctExists = createAccount(ACCT_NAME_EXISTS_LOCALPART);
/* 380 */     String acctId = acct.getId();
/*     */     
/* 382 */     String ACCT_NEW_NAME = acctExists.getName();
/*     */     
/* 384 */     boolean caughtException = false;
/*     */     try {
/* 386 */       prov.renameAccount(acctId, ACCT_NEW_NAME);
/*     */     } catch (AccountServiceException e) {
/* 388 */       if ("account.ACCOUNT_EXISTS".equals(e.getCode())) {
/* 389 */         caughtException = true;
/*     */       }
/*     */     }
/* 392 */     Assert.assertTrue(caughtException);
/*     */     
/* 394 */     deleteAccount(acct);
/* 395 */     deleteAccount(acctExists);
/*     */   }
/*     */   
/*     */   @Test
/*     */   public void mailHost() throws Exception {
/* 400 */     Map<String, Object> server1Attrs = Maps.newHashMap();
/* 401 */     server1Attrs.put("zimbraServiceEnabled", "mailbox");
/* 402 */     Server server1 = createServer(genServerName("1"), server1Attrs);
/*     */     
/* 404 */     Map<String, Object> server2Attrs = Maps.newHashMap();
/* 405 */     server2Attrs.put("zimbraServiceEnabled", "mailbox");
/* 406 */     Server server2 = createServer(genServerName("2"), server2Attrs);
/*     */     
/* 408 */     Server server3 = createServer(genServerName("3"));
/*     */     
/*     */ 
/* 411 */     Map<String, Object> acct1Attrs = Maps.newHashMap();
/* 412 */     acct1Attrs.put("zimbraMailHost", server1.getName());
/* 413 */     Account acct1 = createAccount(genAcctNameLocalPart("1"), acct1Attrs);
/* 414 */     Assert.assertEquals(server1.getId(), prov.getServer(acct1).getId());
/*     */     
/*     */ 
/* 417 */     Map<String, Object> acct2Attrs = Maps.newHashMap();
/* 418 */     acct2Attrs.put("zimbraMailHost", server3.getName());
/* 419 */     boolean caughtException = false;
/*     */     try {
/* 421 */       acct2 = createAccount(genAcctNameLocalPart("2"), acct2Attrs);
/*     */     } catch (ServiceException e) { Account acct2;
/* 423 */       if ("service.INVALID_REQUEST".equals(e.getCode())) {
/* 424 */         caughtException = true;
/*     */       }
/*     */     }
/* 427 */     Assert.assertTrue(caughtException);
/*     */     
/*     */ 
/* 430 */     Map<String, Object> cos1Attrs = Maps.newHashMap();
/* 431 */     cos1Attrs.put("zimbraMailHostPool", server2.getId());
/* 432 */     Cos cos1 = createCos(genCosName("1"), cos1Attrs);
/* 433 */     Map<String, Object> acct3Attrs = Maps.newHashMap();
/* 434 */     acct3Attrs.put("zimbraCOSId", cos1.getId());
/* 435 */     Account acct3 = createAccount(genAcctNameLocalPart("3"), acct3Attrs);
/* 436 */     Assert.assertEquals(server2.getId(), prov.getServer(acct3).getId());
/*     */     
/*     */ 
/*     */ 
/* 440 */     Map<String, Object> cos2Attrs = Maps.newHashMap();
/* 441 */     cos2Attrs.put("zimbraMailHostPool", server3.getId());
/* 442 */     Cos cos2 = createCos(genCosName("3"), cos2Attrs);
/* 443 */     Map<String, Object> acct4Attrs = Maps.newHashMap();
/* 444 */     acct4Attrs.put("zimbraCOSId", cos2.getId());
/* 445 */     Account acct4 = createAccount(genAcctNameLocalPart("4"), acct4Attrs);
/* 446 */     Assert.assertEquals(prov.getLocalServer().getId(), prov.getServer(acct4).getId());
/*     */     
/*     */ 
/* 449 */     deleteAccount(acct1);
/* 450 */     deleteAccount(acct3);
/* 451 */     deleteAccount(acct4);
/* 452 */     deleteServer(server1);
/* 453 */     deleteServer(server2);
/* 454 */     deleteServer(server3);
/* 455 */     deleteCos(cos1);
/* 456 */     deleteCos(cos2);
/*     */   }
/*     */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/qa/unittest/prov/ldap/TestLdapProvAccount.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */